//主窗口的渲染进程脚本
document.getElementById('fileInput').addEventListener('change', (e) => {
  handleFiles(e);
})
let bookData = ''
function handleFiles(e) {
  let file = e.target.files[0]
  let fr = new FileReader();
  fr.readAsText(file, 'GB2312');
  // fr.readAsText(file, 'utf-8');
  fr.onload = function () {
    bookData =  fr.result
  }
}

document.getElementById('save').onclick = () => {
  electronAPI.openDialog(bookData)
}

